Added scaling functions into gtk-doc framework.
authorOwen Taylor <otaylor@redhat.com>
Thu, 6 Jan 2000 01:08:10 +0000 (01:08 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Thu, 6 Jan 2000 01:08:10 +0000 (01:08 +0000)
2000-01-05  Owen Taylor  <otaylor@redhat.com>

* doc/Makefile.am doc/gdk-pixbuf-sections.txt
  doc/gdk-pixbuf.sgml doc/tmpl/scaling.sgml:
Added scaling functions into gtk-doc framework.

* gdk-pixbuf/gdk-pixbuf-scale.c: Documentation fixes.

* gdk-pixbuf/testpixbuf-scale.c (expose_cb): Simplify a bit.

* gdk-pixbuf/pixops/pixops.c (pixops_composite_color): Return
immediately if scale_x or scale_y is 0.

15 files changed:
demos/testpixbuf-scale.c
docs/reference/gdk-pixbuf/Makefile.am
docs/reference/gdk-pixbuf/gdk-pixbuf-decl.txt
docs/reference/gdk-pixbuf/gdk-pixbuf-sections.txt
docs/reference/gdk-pixbuf/gdk-pixbuf.args
docs/reference/gdk-pixbuf/gdk-pixbuf.sgml
docs/reference/gdk-pixbuf/tmpl/animation.sgml
docs/reference/gdk-pixbuf/tmpl/from-drawables.sgml
docs/reference/gdk-pixbuf/tmpl/gdk-pixbuf-unused.sgml
docs/reference/gdk-pixbuf/tmpl/gnome-canvas-pixbuf.sgml
docs/reference/gdk-pixbuf/tmpl/scaling.sgml [new file with mode: 0644]
docs/reference/gdk-pixbuf/tmpl/util.sgml
gdk-pixbuf/ChangeLog
gdk-pixbuf/gdk-pixbuf-scale.c
gdk-pixbuf/pixops/pixops.c

index da2e2b0ed6b2de0da85bee9a9c71e36d6758be14..2efafd6da9cbbf17a9eb767d87de63ac9decab95 100644 (file)
@@ -34,22 +34,13 @@ expose_cb (GtkWidget *widget, GdkEventExpose *event, gpointer data)
   
   dest = gdk_pixbuf_new (ART_PIX_RGB, FALSE, 8, event->area.width, event->area.height);
 
-  if (pixbuf->art_pixbuf->has_alpha || overall_alpha != 255)
-    gdk_pixbuf_composite_color (pixbuf, dest,
-                               0, 0, event->area.width, event->area.height,
-                               -event->area.x, -event->area.y,
-                               (double) widget->allocation.width / pixbuf->art_pixbuf->width,
-                               (double) widget->allocation.height / pixbuf->art_pixbuf->height,
-                               filter_level, overall_alpha,
-                               event->area.x, event->area.y, 16, 0xaaaaaa, 0x555555);
-  else
-    gdk_pixbuf_scale (pixbuf, dest,
-                     0, 0, event->area.width, event->area.height,
-                     -event->area.x, -event->area.y,
-                     (double) widget->allocation.width / pixbuf->art_pixbuf->width,
-                     (double) widget->allocation.height / pixbuf->art_pixbuf->height,
-                     filter_level);
-
+  gdk_pixbuf_composite_color (pixbuf, dest,
+                             0, 0, event->area.width, event->area.height,
+                             -event->area.x, -event->area.y,
+                             (double) widget->allocation.width / pixbuf->art_pixbuf->width,
+                             (double) widget->allocation.height / pixbuf->art_pixbuf->height,
+                             filter_level, overall_alpha,
+                             event->area.x, event->area.y, 16, 0xaaaaaa, 0x555555);
 
   gdk_pixbuf_render_to_drawable (dest, widget->window, widget->style->fg_gc[GTK_STATE_NORMAL],
                                 0, 0, event->area.x, event->area.y,
index 40d2a83956136b615af5261d14289aed7104b2a3..b66ecede0042bd3d01ea9ee615a92388c60be4d2 100644 (file)
@@ -27,6 +27,7 @@ tmpl_sources =                                        \
        tmpl/gnome-canvas-pixbuf.sgml           \
        tmpl/refcounting.sgml                   \
        tmpl/rendering.sgml                     \
+       tmpl/scaling.sgml                       \
        tmpl/util.sgml
 
 gdk_pixbuf_docdir = $(HTML_DIR)
@@ -56,7 +57,7 @@ scan:
        -(cd $(srcdir) \
        && env CFLAGS=$(CFLAGS) LDFLAGS=$(LDFLAGS) \
                 gtkdoc-scanobj --module=$(DOC_MODULE) \
-       && gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) )
+       && gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="pixops.h pixops-internal.h" )
 
 templates: scan
        cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE)
index be6b6adab4ed57d882dbf090586e4ef85d58af4f..884c3247b6d19572e70ebbb82030700009c55677 100644 (file)
@@ -6,9 +6,23 @@ GdkPixbuf *pixbuf, gpointer user_data
 <USER_FUNCTION>
 <NAME>ModuleUpdatedNotifyFunc</NAME>
 <RETURNS>void </RETURNS>
-GdkPixbuf *pixbuf, gpointer user_data,
+GdkPixbuf *pixbuf,
                                          guint x, guint y,
-                                         guint width, guint height
+                                         guint width, guint height,
+                                         gpointer user_data
+</USER_FUNCTION>
+<USER_FUNCTION>
+<NAME>ModuleFrameDoneNotifyFunc</NAME>
+<RETURNS>void </RETURNS>
+GdkPixbuf *pixbuf,
+                                           gint frame,
+                                           gpointer user_data
+</USER_FUNCTION>
+<USER_FUNCTION>
+<NAME>ModuleAnimationDoneNotifyFunc</NAME>
+<RETURNS>void </RETURNS>
+GdkPixbuf *pixbuf,
+                                               gpointer user_data
 </USER_FUNCTION>
 <STRUCT>
 <NAME>GdkPixbufModule</NAME>
@@ -26,6 +40,8 @@ struct GdkPixbufModule {
 
         gpointer (* begin_load) (ModulePreparedNotifyFunc prepare_func,
                                 ModuleUpdatedNotifyFunc update_func,
+                                ModuleFrameDoneNotifyFunc frame_done_func,
+                                ModuleAnimationDoneNotifyFunc anim_done_func,
                                 gpointer user_data);
         void (* stop_load) (gpointer context);
         gboolean (* load_increment) (gpointer context, const guchar *buf, guint size);
@@ -275,6 +291,31 @@ GdkPixbuf *pixbuf, GdkDrawable *drawable,int src_x, int src_y,int dest_x, int de
 GdkPixbuf *dest,GdkDrawable *src, GdkColormap *cmap,int src_x, int src_y,int dest_x, int dest_y,int width, int height
 </FUNCTION>
 <FUNCTION>
+<NAME>gdk_pixbuf_scale</NAME>
+<RETURNS>void  </RETURNS>
+GdkPixbuf      *src,GdkPixbuf      *dest,int             dest_x,int             dest_y,int             dest_width,int             dest_height,double          offset_x,double          offset_y,double          scale_x,double          scale_y,ArtFilterLevel  filter_level
+</FUNCTION>
+<FUNCTION>
+<NAME>gdk_pixbuf_composite</NAME>
+<RETURNS>void  </RETURNS>
+GdkPixbuf      *src,GdkPixbuf      *dest,int             dest_x,int             dest_y,int             dest_width,int             dest_height,double          offset_x,double          offset_y,double          scale_x,double          scale_y,ArtFilterLevel  filter_level,int             overall_alpha
+</FUNCTION>
+<FUNCTION>
+<NAME>gdk_pixbuf_composite_color</NAME>
+<RETURNS>void  </RETURNS>
+GdkPixbuf      *src,GdkPixbuf      *dest,int             dest_x,int             dest_y,int             dest_width,int             dest_height,double          offset_x,double          offset_y,double          scale_x,double          scale_y,ArtFilterLevel  filter_level,int             overall_alpha,int             check_x,int             check_y,int             check_size,art_u32         color1,art_u32         color2
+</FUNCTION>
+<FUNCTION>
+<NAME>gdk_pixbuf_scale_simple</NAME>
+<RETURNS>GdkPixbuf  *</RETURNS>
+GdkPixbuf      *src,int             dest_width,int             dest_height,ArtFilterLevel  filter_level
+</FUNCTION>
+<FUNCTION>
+<NAME>gdk_pixbuf_composite_color_simple</NAME>
+<RETURNS>GdkPixbuf  *</RETURNS>
+GdkPixbuf      *src,int             dest_width,int             dest_height,ArtFilterLevel  filter_level,int             overall_alpha,int             check_size,art_u32         color1,art_u32         color2
+</FUNCTION>
+<FUNCTION>
 <NAME>gdk_pixbuf_animation_new_from_file</NAME>
 <RETURNS>GdkPixbufAnimation  *</RETURNS>
 const char *filename
index bd2af9551527eaa0a7f136393e8a3391780178a6..7de064ea7457a95ae2054018ee905d2002f378af 100644 (file)
@@ -60,6 +60,15 @@ gdk_pixbuf_animation_ref
 gdk_pixbuf_animation_unref
 </SECTION>
 
+<SECTION>
+<FILE>scaling</FILE>
+gdk_pixbuf_scale
+gdk_pixbuf_composite
+gdk_pixbuf_composite_color
+gdk_pixbuf_scale_simple
+gdk_pixbuf_composite_color_simple
+</SECTION>
+
 <SECTION>
 <FILE>gdk-pixbuf-loader</FILE>
 GDK_PIXBUF_LOADER
index 8813bd7b35656bdd700e69a309e6c41dc7d31687..b212136dca410aced5ae7ce08b75d901ff7a03ba 100644 (file)
@@ -17,7 +17,7 @@
 </ARG>
 
 <ARG>
-<NAME>GnomeCanvasPixbuf::width_in_pixels</NAME>
+<NAME>GnomeCanvasPixbuf::width_pixels</NAME>
 <TYPE>gboolean</TYPE>
 <FLAGS>rw</FLAGS>
 </ARG>
@@ -35,7 +35,7 @@
 </ARG>
 
 <ARG>
-<NAME>GnomeCanvasPixbuf::height_in_pixels</NAME>
+<NAME>GnomeCanvasPixbuf::height_pixels</NAME>
 <TYPE>gboolean</TYPE>
 <FLAGS>rw</FLAGS>
 </ARG>
@@ -53,7 +53,7 @@
 </ARG>
 
 <ARG>
-<NAME>GnomeCanvasPixbuf::x_in_pixels</NAME>
+<NAME>GnomeCanvasPixbuf::x_pixels</NAME>
 <TYPE>gboolean</TYPE>
 <FLAGS>rw</FLAGS>
 </ARG>
@@ -71,7 +71,7 @@
 </ARG>
 
 <ARG>
-<NAME>GnomeCanvasPixbuf::y_in_pixels</NAME>
+<NAME>GnomeCanvasPixbuf::y_pixels</NAME>
 <TYPE>gboolean</TYPE>
 <FLAGS>rw</FLAGS>
 </ARG>
index b95e72f7fe2fc305c36cd0208d4be46cea033332..410a2cc3e776e9718be71384763b64db55e08256 100644 (file)
@@ -4,6 +4,7 @@
 <!entity gdk-pixbuf-file-loading SYSTEM "sgml/file-loading.sgml">
 <!entity gdk-pixbuf-creating SYSTEM "sgml/creating.sgml">
 <!entity gdk-pixbuf-rendering SYSTEM "sgml/rendering.sgml">
+<!entity gdk-pixbuf-scaling SYSTEM "sgml/scaling.sgml">
 <!entity gdk-pixbuf-from-drawables SYSTEM "sgml/from-drawables.sgml">
 <!entity gdk-pixbuf-util SYSTEM "sgml/util.sgml">
 <!entity gdk-pixbuf-animation SYSTEM "sgml/animation.sgml">
@@ -49,6 +50,7 @@
     &gdk-pixbuf-file-loading;
     &gdk-pixbuf-creating;
     &gdk-pixbuf-rendering;
+    &gdk-pixbuf-scaling;
     &gdk-pixbuf-from-drawables;
     &gdk-pixbuf-util;
     &gdk-pixbuf-animation;
index f578a841e718e36fba5b0a284316625d50e38e5a..ff23a563212b90fc5fcc674890f881f7f081585d 100644 (file)
@@ -13,13 +13,11 @@ Animations as multi-frame structures.
     about the frame's overlay mode and duration.
   </para>
 
-
 <!-- ##### SECTION See_Also ##### -->
   <para>
     #GdkPixbufLoader
   </para>
 
-
 <!-- ##### ENUM GdkPixbufFrameAction ##### -->
   <para>
     Each animation frame can have several things happen to it when the
@@ -82,12 +80,11 @@ Animations as multi-frame structures.
 
 </para>
 
-@animation: 
-
-
-<!--
+@animation: <!--
 Local variables:
 mode: sgml
 sgml-parent-document: ("../gdk-pixbuf.sgml" "book" "refsect2" "")
 End:
 -->
+
+
index 3415bcb123240e419f0d852385569306178178df..252d57bfa4c443564311f117f0d958bdda5bf60f 100644 (file)
@@ -32,9 +32,7 @@ Getting parts of a drawable's image data into a pixbuf.
 @dest_y: 
 @width: 
 @height: 
-@Returns: 
-
-<!--
+@Returns: <!--
 Local variables:
 mode: sgml
 sgml-parent-document: ("../gdk-pixbuf.sgml" "book" "refsect2" "")
index 1ac20cb80bede648c7d628b5ab67ace214af4bac..389771cf3f9f061566f6a97927be6cc13219bfe6 100644 (file)
@@ -1,3 +1,14 @@
+<!-- ##### ARG GnomeCanvasPixbuf:width_in_pixels ##### -->
+  <para>
+    If this argument is %TRUE, then the width of the pixbuf will be
+    considered to be in pixels, that is, it will not be visually
+    scaled even if the item's affine transformation changes.  If this
+    is %FALSE, then the width of the pixbuf will be considered to be
+    in canvas units, and so will be scaled normally by affine
+    transformations.  The default is %FALSE.
+  </para>
+
+
 <!-- ##### SECTION ./tmpl/gdk-pixbuf-io.sgml:See_Also ##### -->
 <para>
 
 
 
 
+<!-- ##### ARG GnomeCanvasPixbuf:height_in_pixels ##### -->
+  <para>
+    Works in the same way as the <link
+    linkend="GnomeCanvasPixbuf--width-in-pixels">width_in_pixels</link>
+    argument.  The default is %FALSE.
+  </para>
+
+
 <!-- ##### STRUCT GdkPixbufModule ##### -->
 <para>
 
 @stop_load: 
 @load_increment: 
 
+<!-- ##### ARG GnomeCanvasPixbuf:y_in_pixels ##### -->
+  <para>
+    Works in the same way as the <link
+    linkend="GnomeCanvasPixbuf--x-in-pixels">x_in_pixels</link>
+    argument.  The default is %FALSE.
+  </para>
+
+<!--
+Local variables:
+mode: sgml
+sgml-parent-document: ("../gdk-pixbuf.sgml" "book" "refsect2" "")
+End:
+-->
+
+
 <!-- ##### SECTION ./tmpl/gdk-pixbuf-io.sgml:Long_Description ##### -->
 <para>
 
@@ -68,3 +102,14 @@ gdk-pixbuf-io
 @size: 
 @Returns: 
 
+<!-- ##### ARG GnomeCanvasPixbuf:x_in_pixels ##### -->
+  <para>
+    If this argument is %TRUE, the pixbuf's translation with respect
+    to its logical origin in item-relative coordinates will be in
+    pixels, that is, the visible offset will not change even if the
+    item's affine transformation changes.  If it is %FALSE, the
+    pixbuf's translation will be taken to be in canvas units, and thus
+    will change along with the item's affine transformation.
+  </para>
+
+
index fd5d97e5bfb04a85ef56d24fc3e972423dfb6f1f..cd2116528bb95c2be1ad9291fe01f85d79801dc8 100644 (file)
@@ -234,15 +234,10 @@ Canvas item to display #GdkPixbuf images.
     used instead.  This argument is %FALSE by default.
   </para>
 
-<!-- ##### ARG GnomeCanvasPixbuf:width_in_pixels ##### -->
-  <para>
-    If this argument is %TRUE, then the width of the pixbuf will be
-    considered to be in pixels, that is, it will not be visually
-    scaled even if the item's affine transformation changes.  If this
-    is %FALSE, then the width of the pixbuf will be considered to be
-    in canvas units, and so will be scaled normally by affine
-    transformations.  The default is %FALSE.
-  </para>
+<!-- ##### ARG GnomeCanvasPixbuf:width_pixels ##### -->
+<para>
+
+</para>
 
 <!-- ##### ARG GnomeCanvasPixbuf:height ##### -->
   <para>
@@ -263,12 +258,10 @@ Canvas item to display #GdkPixbuf images.
     The default is %FALSE.
   </para>
 
-<!-- ##### ARG GnomeCanvasPixbuf:height_in_pixels ##### -->
-  <para>
-    Works in the same way as the <link
-    linkend="GnomeCanvasPixbuf--width-in-pixels">width_in_pixels</link>
-    argument.  The default is %FALSE.
-  </para>
+<!-- ##### ARG GnomeCanvasPixbuf:height_pixels ##### -->
+<para>
+
+</para>
 
 <!-- ##### ARG GnomeCanvasPixbuf:x ##### -->
   <para>
@@ -287,15 +280,10 @@ Canvas item to display #GdkPixbuf images.
     coordinates.
   </para>
 
-<!-- ##### ARG GnomeCanvasPixbuf:x_in_pixels ##### -->
-  <para>
-    If this argument is %TRUE, the pixbuf's translation with respect
-    to its logical origin in item-relative coordinates will be in
-    pixels, that is, the visible offset will not change even if the
-    item's affine transformation changes.  If it is %FALSE, the
-    pixbuf's translation will be taken to be in canvas units, and thus
-    will change along with the item's affine transformation.
-  </para>
+<!-- ##### ARG GnomeCanvasPixbuf:x_pixels ##### -->
+<para>
+
+</para>
 
 <!-- ##### ARG GnomeCanvasPixbuf:y ##### -->
   <para>
@@ -314,17 +302,8 @@ Canvas item to display #GdkPixbuf images.
     default is %FALSE.
   </para>
 
-<!-- ##### ARG GnomeCanvasPixbuf:y_in_pixels ##### -->
-  <para>
-    Works in the same way as the <link
-    linkend="GnomeCanvasPixbuf--x-in-pixels">x_in_pixels</link>
-    argument.  The default is %FALSE.
-  </para>
+<!-- ##### ARG GnomeCanvasPixbuf:y_pixels ##### -->
+<para>
 
-<!--
-Local variables:
-mode: sgml
-sgml-parent-document: ("../gdk-pixbuf.sgml" "book" "refsect2" "")
-End:
--->
+</para>
 
diff --git a/docs/reference/gdk-pixbuf/tmpl/scaling.sgml b/docs/reference/gdk-pixbuf/tmpl/scaling.sgml
new file mode 100644 (file)
index 0000000..153a5cf
--- /dev/null
@@ -0,0 +1,162 @@
+<!-- ##### SECTION Title ##### -->
+Scaling
+
+<!-- ##### SECTION Short_Description ##### -->
+Scaling pixbufs and scaling and compositing pixbufs
+
+<!-- ##### SECTION Long_Description ##### -->
+<para>
+gdk-pixbuf contains functions to scale pixbufs, to scale pixbufs and
+composite against an existing image, and to scale pixbufs and
+composite against a solid color or checkerboard.  (Compositing a
+checkerboard is a common way to show an image with an alpha-channel in
+image-viewing and editing software.)
+</para>
+<para>
+Since the full-featured functions (gdk_pixbuf_scale(),
+gdk_pixbuf_composite(), and gdk_pixbuf_composite_color()) are
+rather complex to use and have many arguments, two simple
+convenience functions are provided, gdk_pixbuf_scale_simple()
+and gdk_pixbuf_composite_color_simple() which create a
+new pixbuf of a given size, scale an original image to fit,
+and then return the new pixmap.
+</para>
+
+<para>
+The following example demonstrates handling an expose event by
+rendering the appropriate area of a source image (which is scaled to
+fit the widget) onto the widget's window.  The source image is
+rendered against a checkerboard, which provides a visual
+representation of the alpha channel if the image has one. If the image
+doesn't have an alpha channel, calling gdk_pixbuf_composite_color()
+function has exactly the same effect as calling gdk_pixbuf_scale().
+</para>
+
+<programlisting>
+gboolean
+expose_cb (GtkWidget *widget, GdkEventExpose *event, gpointer data)
+{
+  GdkPixbuf *dest;
+
+  gdk_window_set_back_pixmap (widget->window, NULL, FALSE);
+  
+  dest = gdk_pixbuf_new (ART_PIX_RGB, FALSE, 8, event->area.width, event->area.height);
+
+  gdk_pixbuf_composite_color (pixbuf, dest,
+                              0, 0, event->area.width, event->area.height,
+                              -event->area.x, -event->area.y,
+                              (double) widget->allocation.width / pixbuf->art_pixbuf->width,
+                              (double) widget->allocation.height / pixbuf->art_pixbuf->height,
+                              filter_level, 255,
+                               event->area.x, event->area.y, 16, 0xaaaaaa, 0x555555);
+
+  gdk_pixbuf_render_to_drawable (dest, widget->window, widget->style->fg_gc[GTK_STATE_NORMAL],
+                                 0, 0, event->area.x, event->area.y,
+                                 event->area.width, event->area.height,
+                                 GDK_RGB_DITHER_NORMAL, event->area.x, event->area.y);
+  
+  gdk_pixbuf_unref (dest);
+  
+  return TRUE;
+}
+</programlisting>
+
+<!-- ##### SECTION See_Also ##### -->
+<para>
+
+</para>
+
+<!-- ##### FUNCTION gdk_pixbuf_scale ##### -->
+<para>
+
+</para>
+
+@src: 
+@dest: 
+@dest_x: 
+@dest_y: 
+@dest_width: 
+@dest_height: 
+@offset_x: 
+@offset_y: 
+@scale_x: 
+@scale_y: 
+@filter_level: 
+
+
+<!-- ##### FUNCTION gdk_pixbuf_composite ##### -->
+<para>
+
+</para>
+
+@src: 
+@dest: 
+@dest_x: 
+@dest_y: 
+@dest_width: 
+@dest_height: 
+@offset_x: 
+@offset_y: 
+@scale_x: 
+@scale_y: 
+@filter_level: 
+@overall_alpha: 
+
+
+<!-- ##### FUNCTION gdk_pixbuf_composite_color ##### -->
+<para>
+
+</para>
+
+@src: 
+@dest: 
+@dest_x: 
+@dest_y: 
+@dest_width: 
+@dest_height: 
+@offset_x: 
+@offset_y: 
+@scale_x: 
+@scale_y: 
+@filter_level: 
+@overall_alpha: 
+@check_x: 
+@check_y: 
+@check_size: 
+@color1: 
+@color2: 
+
+
+<!-- ##### FUNCTION gdk_pixbuf_scale_simple ##### -->
+<para>
+
+</para>
+
+@src: 
+@dest_width: 
+@dest_height: 
+@filter_level: 
+@Returns: 
+
+
+<!-- ##### FUNCTION gdk_pixbuf_composite_color_simple ##### -->
+<para>
+
+</para>
+
+@src: 
+@dest_width: 
+@dest_height: 
+@filter_level: 
+@overall_alpha: 
+@check_size: 
+@color1: 
+@color2: 
+@Returns: 
+
+<!--
+Local variables:
+mode: sgml
+sgml-parent-document: ("../gdk-pixbuf.sgml" "book" "refsect2" "")
+End:
+-->
\ No newline at end of file
index 3509f766817b52956c5138497863593d4484af66..f84edb50e0b274166fa325722a6c60ad27ada1a6 100644 (file)
@@ -27,8 +27,7 @@ Utility and miscellaneous convenience functions.
 @r: 
 @g: 
 @b: 
-@Returns: 
-<!--
+@Returns: <!--
 Local variables:
 mode: sgml
 sgml-parent-document: ("../gdk-pixbuf.sgml" "book" "refsect2" "")
index 2387d2478dc2494a711ac13b079ebad62d94e31a..852e106adf2edf1b717f52424c7d0075c8327b82 100644 (file)
@@ -1,3 +1,16 @@
+2000-01-05  Owen Taylor  <otaylor@redhat.com>
+
+       * doc/Makefile.am doc/gdk-pixbuf-sections.txt
+         doc/gdk-pixbuf.sgml doc/tmpl/scaling.sgml: 
+       Added scaling functions into gtk-doc framework.
+
+       * gdk-pixbuf/gdk-pixbuf-scale.c: Documentation fixes.
+
+       * gdk-pixbuf/testpixbuf-scale.c (expose_cb): Simplify a bit.
+
+       * gdk-pixbuf/pixops/pixops.c (pixops_composite_color): Return
+       immediately if scale_x or scale_y is 0.
+
 2000-01-05  Owen Taylor  <otaylor@redhat.com>
 
        * gdk-pixbuf/pixops/timescale.c: quick fix for initializing
index 6e0861f1e2306590b05b466e93f6c41bad1890ee..a3e7859ed7fe2808fe62c7eca84e1b2ae00974df 100644 (file)
@@ -6,10 +6,10 @@
  * gdk_pixbuf_scale:
  * @src: a #GdkPixbuf
  * @dest: the #GdkPixbuf into which to render the results
- * @dest_x: 
- * @dest_y: 
- * @dest_width: 
- * @dest_height: 
+ * @dest_x: the left coordinate for region to render
+ * @dest_y: the top coordinate for region to render
+ * @dest_width: the width of the region to render
+ * @dest_height: the height of the region to render
  * @offset_x: the offset in the X direction (currently rounded to an integer)
  * @offset_y: the offset in the Y direction (currently rounded to an integer)
  * @scale_x: the scale factor in the X direction
@@ -49,10 +49,10 @@ gdk_pixbuf_scale (GdkPixbuf      *src,
  * gdk_pixbuf_composite:
  * @src: a #GdkPixbuf
  * @dest: the #GdkPixbuf into which to render the results
- * @dest_x: 
- * @dest_y: 
- * @dest_width: 
- * @dest_height: 
+ * @dest_x: the left coordinate for region to render
+ * @dest_y: the top coordinate for region to render
+ * @dest_width: the width of the region to render
+ * @dest_height: the height of the region to render
  * @offset_x: the offset in the X direction (currently rounded to an integer)
  * @offset_y: the offset in the Y direction (currently rounded to an integer)
  * @scale_x: the scale factor in the X direction
@@ -93,10 +93,10 @@ gdk_pixbuf_composite (GdkPixbuf      *src,
  * gdk_pixbuf_composite_color:
  * @src: a #GdkPixbuf
  * @dest: the #GdkPixbuf into which to render the results
- * @dest_x: 
- * @dest_y: 
- * @dest_width: 
- * @dest_height: 
+ * @dest_x: the left coordinate for region to render
+ * @dest_y: the top coordinate for region to render
+ * @dest_width: the width of the region to render
+ * @dest_height: the height of the region to render
  * @offset_x: the offset in the X direction (currently rounded to an integer)
  * @offset_y: the offset in the Y direction (currently rounded to an integer)
  * @scale_x: the scale factor in the X direction
index ac901064e5e14f8c86f248b245c1dbbf3b6382ee..bfc7c7b51ae6cc81b6883421ac62874735f1ffbe 100644 (file)
@@ -1322,6 +1322,9 @@ pixops_composite_color (art_u8         *dest_buf,
   g_return_if_fail (!(dest_channels == 3 && dest_has_alpha));
   g_return_if_fail (!(src_channels == 3 && src_has_alpha));
 
+  if (scale_x == 0 || scale_y == 0)
+    return;
+
   if (!src_has_alpha && overall_alpha == 255)
     pixops_scale (dest_buf, render_x0, render_y0, render_x1, render_y1,
                  dest_rowstride, dest_channels, dest_has_alpha,
@@ -1398,6 +1401,9 @@ pixops_composite (art_u8        *dest_buf,
   g_return_if_fail (!(dest_channels == 3 && dest_has_alpha));
   g_return_if_fail (!(src_channels == 3 && src_has_alpha));
 
+  if (scale_x == 0 || scale_y == 0)
+    return;
+
   if (!src_has_alpha && overall_alpha == 255)
     pixops_scale (dest_buf, render_x0, render_y0, render_x1, render_y1,
                  dest_rowstride, dest_channels, dest_has_alpha,
@@ -1478,6 +1484,9 @@ pixops_scale (art_u8        *dest_buf,
   g_return_if_fail (!(src_channels == 3 && src_has_alpha));
   g_return_if_fail (!(src_has_alpha && !dest_has_alpha));
 
+  if (scale_x == 0 || scale_y == 0)
+    return;
+
   switch (filter_level)
     {
     case ART_FILTER_NEAREST: